import request from "@/apps/admin/units/request"
import {TableColumn} from "@/components/AppTable/TableType";

type FilterData = {
    api: string
    columns: TableColumn[]
    labelKey?: string
    query?: { [key: string]: any }
}

/**
 * 部门授权数据员工
 */
export const depauthUserFilterData: FilterData = {
    api: '/filter-panel/depauth-user',
    columns: [
        {prop: 'id', label: 'id', minWidth: 80},
        {prop: 'nickname', label: '昵称', minWidth: 130},
        {prop: 'account', label: '帐号', minWidth: 150},
        {prop: 'avatar', label: '头像', type: 'image', minWidth: 80},
        {prop: 'created_at', label: '创建时间', type: 'timestramp', minWidth: 170},
    ],
    labelKey: "nickname",
};


/**
 * 获取律所信息
 */
export const LawyerHouseFilterData: FilterData = {
    api: '/filter-panel/house',
    columns: [
        {prop: 'id', label: 'id', width: 80},
        {prop: 'name', label: '律所名称', minWidth: 130},
        {prop: 'region', label: '地区', minWidth: 150},
        {prop: 'address', label: '律所地址', minWidth: 250},
        {prop: 'created_at', label: '创建时间', type: 'timestramp', minWidth: 170},
    ],
}


/**
 * 获取律所信息
 */
export const LawyerFilterData: FilterData = {
    api: '/filter-panel/lawyer',
    columns: [
        {prop: 'id', label: 'id', width: 80},
        {prop: 'nickname', label: '律师名称', minWidth: 130},
        {prop: 'region', label: '地区', minWidth: 150},
        {prop: 'mobile', label: '电话', minWidth: 130},
        {prop: 'avatar', label: '头像', type: "image", minWidth: 130}
    ],
    query: {
        status: 1,
        is_auth: 1
    },
    labelKey: "nickname"
}

/**
 * 获取登录省市数据树
 */
export function getProvinceCityByTree() {
    return request(`/filter-panel/province-city-tree`)
}